﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Microhard.Core;
using Microhard.Permission.Interface;
using Microhard.Permission.Models;

namespace Microhard.Permission.MVCFilter
{
    public class MVCFilterAtrForRecordDataInDataPermission : ActionFilterAttribute
    {
        private IDataPermission id = IoC.Resolve<IDataPermission>();

        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            string actionName = filterContext.ActionDescriptor.ActionName.ToLower();
            IAfterActionDataFilter filter = new AfterSaveCreateActionFilter();
            filter.DataPermission = id;
            if (filter != null)
            {
                filter.FilterAction(filterContext,null);
            }
        }
    }
}
